/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package afterubuntu.log;

import org.apache.log4j.Logger;

/**
 *
 * @author Kermit
 */
public class Log {

    public static final int INFO = 0;
    public static final int WARNING = 1;
    public static final int ERROR = 2;

    private Logger log;

    private static Log instance = null;

    private Log(){
        log = Logger.getLogger(Log.class);
    }

    public static Log getInstance(){
        if(instance == null)
            instance = new Log();
        return instance;
    }

    public void log(int level, String text){
        switch(level){
            case Log.INFO:
                log.info(text);
                break;
            case Log.WARNING:
                log.warn(text);
                break;
            case Log.ERROR:
                log.error(text);
                break;
            default:
                break;
        }
    }

}
